<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue2.6.12.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<input type="text" name="" id="" v-model="inps"/>
			<button type="button" @click="add()">add</button>
			<div>
				<ul>
					<li v-for="(item,index) in lists">{{item}} <button type="button" @click="del(index)">del</button></li>
				</ul>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var vm = new Vue({
			el:'#app',
			data:{
				'inps':'',
				'lists':[]
			},
			methods:{
				add(){
					this.lists.push(this.inps);
				},
				del(index){
					this.lists.splice(index,1);
				}
			}
		})
	</script>
</html>
